package org.jeecg.modules.demo.com.kunpeng.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.com.kunpeng.entity.ProjectPurchase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.demo.com.kunpeng.vo.ProjectPurchaseDetailsVO;
import org.jeecg.modules.demo.com.kunpeng.vo.ProjectPurchaseListQueryVO;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;

/**
 * @Description: 项目采购表
 * @Author: jeecg-boot
 * @Date:   2022-12-15
 * @Version: V1.0
 */
@Repository
public interface ProjectPurchaseMapper extends BaseMapper<ProjectPurchase> {

    /**
     * 全局搜索
     * @return
     */
    List<ProjectPurchaseListQueryVO> listByKeyWords(Page<ProjectPurchaseListQueryVO> page, @Param("startTime")Date startTime,
                                                    @Param("endTime")Date endTime,@Param("projectName")String projectName,
                                                    @Param("responsibilityPerson")String responsibilityPerson,@Param("keyWords")String keyWords);

    /**
     * 根据id查询项目采购详情
     * @param id
     * @return
     */
    ProjectPurchaseDetailsVO selectProjectPurchaseDetailsById(String id);

    /**
     * 根据项目id获取项目采购表数据
     */
    List<ProjectPurchase> listProjectPurchaseByPjId(String PjId);

    /**
     * 根据项目编号查询项目采购
     * @param projectId
     * @return
     */
    List<ProjectPurchaseListQueryVO> listByProjectId(Page<ProjectPurchaseListQueryVO> page,String projectId);

    /**
     * 根据采购单号查询列表
     * @param purchaseId
     * @return
     */
    List<ProjectPurchase> listByPurchaseId(String purchaseId);

    /**
     * 根据采购单号前缀模糊查询采购列表
     */
    List<ProjectPurchase> listPurchaseIdByPurchaseId(String purchasePrefix);

    /**
     * 根据id修改项目采购isDelete状态
     */
    int updateProjectPurchaseIsDeleteById(String id);


    /**
     * 根据id修改项目采购数据
     */
    int updateProjectPurchaseById(ProjectPurchase projectPurchase);

    /**
     * 根据id修改项目采购状态
     */
    int updateProjectPurchaseStatus(String id,String state);
}
